package com.lbx.service.impl;

import com.lbx.entity.Books;
import com.lbx.mapper.BooksMapper;
import com.lbx.service.BooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 吕兵星
 * @date 2020/10/23 23:03
 */
@Service
public class BooksServiceImpl implements BooksService {
    @Autowired
    private BooksMapper booksMapper;

    public void setBooksMapper(BooksMapper booksMapper) {
        this.booksMapper = booksMapper;
    }

    @Override
    public int addBook(Books books) {
        return booksMapper.addBook(books);
    }


    @Override
    public int deleteBook(int id) {
        return booksMapper.deleteBook(id);
    }


    @Override
    public int updateBook(Books books) {
        return booksMapper.updateBook(books);
    }


    @Override
    public Books selectBook(int id) {
        return booksMapper.selectBook(id);
    }

    /**
     * TODO
     *
     * @return java.util.List<com.lbx.entity.Books>
     * @author 吕兵星
     * @date 2020/10/24 9:59
     */
    @Override
    public List<Books> findAll() {
        return booksMapper.findAll();
    }
}
